home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / include / mgglP.h < prev    next >
C/C++ Source or Header  |  1993-08-20  |  2KB  |  57 lines

  1. /* Copyright (c) 1992 The Geometry Center; University of Minnesota
  2.    1300 South Second Street;  Minneapolis, MN  55454, USA;
  3.    
  4. This file is part of geomview/OOGL. geomview/OOGL is free software;
  5. you can redistribute it and/or modify it only under the terms given in
  6. the file COPYING, which you should have received along with this file.
  7. This and other related software may be obtained via anonymous ftp from
  8. geom.umn.edu; email: software@geom.umn.edu. */
  9.  
  10. /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
  11.  
  12. #include "mggl.h"
  13.  
  14. typedef struct mgglcontext {
  15.   struct mgcontext mgctx;    /* The mgcontext */
  16.   int born;            /* Has window been displayed on the screen? */
  17.   int win;            /* GL window ID, or 0 */
  18.   long zmin, zmax;        /* max z-buffer value */
  19.   short is_PI;            /* Personal Iris? (pgon vs tmesh speed) */
  20.   short turbo;            /* Turbo PI flag: for bug workaround */
  21.   void (*d4f)();        /* For shaded colors: mggl_d4f() or c4f() */
  22.   ColorA Cd;            /* Cached diffuse color = mat->diffuse * Kd */
  23.   int lmcolor;            /* lmcolor: LMC_DIFFUSE or LMC_COLOR */
  24.   int cantwoside;        /* hardware will do 2-sided lighting (auto normal flipping) */
  25.   void (*n3f)();        /* For everted normals: n3f(n, p) */ 
  26.   Point3 cpos;            /* current-coordinate position of camera
  27.                  * (used for software normal flipping) */
  28.  
  29.   long znudge;            /* _mgc.zfnudge in integer Z-buffer units */
  30.   long znear, zfar;        /* Current Z-buffer lsetdepth() limits */
  31.   int oldopts;            /* For knowing when we need to gconfig() */
  32.   vvec room;            /* Scratch space */
  33.   void *GLXdisplay;        /* X11 Display pointer; if non-NULL, mixed model */
  34. } mgglcontext;
  35.  
  36.  
  37. #define    MAXZNUDGE    8    /* Max possible depth of mggl_closer()/farther() calls */
  38.  
  39. /* We save the current W2C/C2W xforms on each call to mggl_worldbegin()
  40.  * because the ModelView matrix stack actually stores both our object
  41.  * xform and the view matrix:
  42.  *
  43.  *   ModelView = [ obj xform ] * [ W2C ]
  44.  *
  45.  * Since we use the GL ModelView stack to keep track of our object xform,
  46.  * instead of using the actual stack in the mgcontext struct, having
  47.  * ModelView = W2C corresponds to [ obj xform ] = identity.  We save W2C
  48.  * and C2W on each mggl_worldbegin() because _mgc->cam might change
  49.  * during the course of the frame, but isn't supposed to be reinterpreted
  50.  * until the next mggl_worldbegin().
  51.  */
  52.  
  53. #define _mgglc        ((mgglcontext*)_mgc)
  54.  
  55. void mggl_d4f( float c[4] );
  56. void mggl_n3fevert( Point3 *n, HPoint3 *p );
  57.